<template>
  <div class="logincontainer">
    <el-form ref="loginFormRef" class="loginForm" :model="loginModel" :rules="rules" :inline="false">
      <el-form-item>
        <div class="loginTitle">系统登录</div>
      </el-form-item>
      <el-form-item prop="userName">
        <el-input v-model="loginModel.userName" placeholder="请输入账户" />
      </el-form-item>
      <el-form-item prop="code">
        <el-input v-model="loginModel.code" type="code" placeholder="请输入密码" />
      </el-form-item>
      <el-form-item>
        <el-row :gutter="20" style="margin-top: 10px">
          <el-col :span="12">
            <el-button class="mybtn" type="primary" size="default" @click="login(loginModel)">登录</el-button>
          </el-col>
          <el-col :span="12">
            <el-button class="mybtn" size="default">取消</el-button>
          </el-col>
        </el-row>
      </el-form-item>
    </el-form>
  </div>
</template>
<script setup lang='ts'>
import useBaseLogin from '@/composables/login/useBaseLogin'
import useLoginRequest from '@/composables/login/useLoginRequest'
//基础数据
const { loginModel, rules, loginFormRef } = useBaseLogin()
const { login } = useLoginRequest()
</script>
<style scoped lang='scss'>
.logincontainer {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  .loginForm {
    height: 320px;
    width: 400px;
    border-radius: 10px;
    padding: 20px 35px;
    box-shadow: 0 0 25px #cac6c6;
    .loginTitle {
      font-size: 24px;
      font-weight: 600;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .mybtn {
      width: 100%;
    }
  }
}
</style>